package bg.btanev.eightyfour.shared.analytics;

import java.util.Date;

/**
 *
 * @author B.Tanev
 *
 */
public class DayHourActivityStat extends DayActivityStat {
	/**
	 *
	 */
	private static final long serialVersionUID = -5995408264689606160L;

	private int hour;

	protected DayHourActivityStat() {
		super();
	}

	protected DayHourActivityStat(double hour, Date day, long total) {
		super(day, total);

		int hourNum = (int) hour;
		this.hour = hourNum;
	}

	public int getHour() {
		return hour;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + hour;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		DayHourActivityStat other = (DayHourActivityStat) obj;
		if (hour != other.hour)
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "DayHourActivityStat [hour=" + hour + ", toString()=" + super.toString() + "]";
	}
}
